package edu.umd.ion.wavemeter.server;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import edu.umd.ion.wavemeter.service.CalibrationSettings;

@SuppressWarnings("serial")
@Entity(name = "CalibrationSettings")
@Table(name = "CalibrationSettings") //Name of the entity
@NamedQueries({
    @NamedQuery(name="AllCalibrationSettings",
        query="SELECT x FROM CalibrationSettings x")
})
public class PersistentCalibrationSettings implements Serializable, PersistentObject<Integer, PersistentCalibrationSettings> {
	@Id
	protected Integer Channel;
	protected double CalibrationWavelength;
	protected int Serial;
	
	public void set(CalibrationSettings s) {
		Channel = s.Channel;
		CalibrationWavelength = s.CalibrationWavelength;
		Serial = s.Serial;
	}

	public void set(PersistentCalibrationSettings s) {
		Channel = s.Channel;
		CalibrationWavelength = s.CalibrationWavelength;
		Serial = s.Serial;
	}
	
	public CalibrationSettings plain() {
		CalibrationSettings s = new CalibrationSettings();
		s.CalibrationWavelength = CalibrationWavelength;
		s.Channel = Channel;
		s.Serial = Serial;
		return s;
	}
	
	public int getChannel() {
		return Channel;
	}
	public void setChannel(int channel) {
		Channel = channel;
	}
	public double getCalibrationWavelength() {
		return CalibrationWavelength;
	}
	public void setCalibrationWavelength(double calibrationWavelength) {
		CalibrationWavelength = calibrationWavelength;
	}
	public int getSerial() {
		return Serial;
	}
	public void setSerial(int serial) {
		Serial = serial;
	}

	@Override
	public Integer getPrimaryKey() {
		return Channel;
	}
	
	
}
